<template>
	<view class="mainOrder">
		<!-- <view class="wrap"> -->
		<view>
			<u-sticky offset-top="0" :enable="enable" @fixed="tabTop = true" @unfixed="tabTop = false">
				<!-- <u-navbar title="订单" :is-back="false" :border-bottom="false"></u-navbar> -->
				<view class="u-tabs-box">
					<u-tabs :list="listTab" activeColor="#FBB000" font-size="28" active-color="#333333"
						inactiveColor='#666666' :is-scroll="false" :current="swiperCurrent" @change="change"></u-tabs>
					<!-- <u-tabs-swiper activeColor="#FBB000" ref="tabs" inactive-color="#666666" :list="listTab" :current="current"
						 @change="change" :is-scroll="false"></u-tabs-swiper> -->
					<!-- <view style="width: 100%;height: 15rpx;background-color: rgb(246,246,246);"></view> -->
					<view>
						<!-- 购车 -->
						<u-tabs v-if="swiperCurrent === 0" :duration="0.3" active-color="#FBB000" :is-scroll="false"
							inactive-color="#666666" font-size="24rpx" :show-bar="false" :list="listTitle"
							@change="current2Change" :current="currentTab"></u-tabs>
					</view>
					<view style="border-top: 2rpx solid #EEEEEE;"></view>

					<!-- tabs -->

					<!-- 一成首付 -->
					<view v-show="swiperCurrent === 0 && currentTab === 0">
						<u-tabs :list="list" :duration="0.3" :is-scroll="false" :current="current2"
							inactive-color="#666666" @change="changeTabs" font-size="25" :gutter="10" :show-bar="false"
							active-color="#FBB000"></u-tabs>
					</view>

					<!-- 预约 -->
					<view v-show="swiperCurrent === 0 && currentTab === 2">
						<u-tabs :list="yYlist" :duration="0.3" :is-scroll="false" :current="current3"
							inactive-color="#666666" @change="changeYyTabs" font-size="25" :show-bar="false"
							active-color="#FBB000"></u-tabs>
					</view>
					<!-- 询价 -->
					<view v-show="swiperCurrent === 0 && currentTab === 1">
						<u-tabs inactive-color="#666666" :list="findOrder" :is-scroll="false" :duration="0.3"
							:current="findCurrent" @change="changeFind" font-size="25" :show-bar="false"
							active-color="#FBB000" bg-color="#FFFFFF"></u-tabs>
					</view>
					<view v-show="swiperCurrent === 1">
						<u-subsection :list="maintenNavlist" bg-color="#fff" active-color="#FBB000"
							:current="maintenCurNow" @change="maintenChange"></u-subsection>
					</view>
				</view>

			</u-sticky>
		</view>

		<view class="main">
			<page-loading :show='pageLoading' height="100%">
				<swiper duration="100" class="swiper" :current="swiperCurrent" @change="swierChange">
					<swiper-item class="swiper-item">

						<!-- 购车订单 -->
						<view v-show="currentTab === 0">
							<scroll-view scroll-y class="scroll-view" @scrolltolower="scrolltolower">
								<view class="order-manage-list" v-if="swiperCurrent === 0">
									<buy-list :resetTimes="resetTimes"></buy-list>
									<defaultImg :show='resetTimes.length===0&&isdefault'></defaultImg>
									<u-loadmore :status="statuss" margin-top="50" @loadmore="buyCarMore"
										v-show="resetTimes.length!==0" />
								</view>
							</scroll-view>
						</view>

						<!-- 询价 -->
						<view v-show="currentTab === 1">

							<scroll-view class="scroll-view" scroll-y @scrolltolower="findScrolltolower">
								<view class="order-manage-list" v-if="swiperCurrent === 0">
									<find-car-list :findList='findList'></find-car-list>
									<u-loadmore :status="statuss" margin-top="50" v-show="findList.length!==0"
										@loadmore="findMore" />
									<defaultImg :show='findList.length===0&&findDefault'></defaultImg>
								</view>
							</scroll-view>
						</view>

						<!-- 预约 -->
						<view v-show="currentTab === 2">

							<scroll-view class="scroll-view" scroll-y @scrolltolower="appointmentMore">
								<!-- 预约到店 -->
								<view class="order-manage-list" v-if="swiperCurrent === 0">
									<appointment-list :appointmentList='appointmentList' @cancel='cancel'>
									</appointment-list>
									<u-loadmore :status="statuss" margin-top="50" v-show="appointmentList.length!==0"
										@loadmore="appointmentMore" />
									<defaultImg :show='appointmentList.length===0&&defaultYy'></defaultImg>
								</view>
							</scroll-view>
						</view>
					</swiper-item>

					<!-- 维保单 -->
					<swiper-item>
						<scroll-view class="scroll-view" scroll-y @scrolltolower="maintenMore">
							<view class="" v-if="maintenanceList.length>0">
								<maintenanceOrderList :list='maintenanceList'></maintenanceOrderList>
								<u-loadmore :status="maintenanceStatuss" margin-top="50" />
							</view>
							<view class="" v-else>
								<defaultImg :show='maintenanceList.length===0&&showWb'></defaultImg>
							</view>

						</scroll-view>
					</swiper-item>
				</swiper>
			</page-loading>
		</view>

		<!-- </view> -->

		<!-- 确认提车 -->
		<u-modal v-model="isCollection" title="" :show-cancel-button="true" confirm-color="#FBD220">
			<view class="flex flex-jc-c" style="line-height: 200rpx;">确认提车</view>
		</u-modal>

		<!-- 取消预约 -->
		<u-modal v-model="show" :show-confirm-button="false" :show-title="false" :mask-close-able="true">
			<view>
				<view class="modal-title">客官！您真的要残忍取消吗？</view>
				<view class="btn flex flex-ai-c flex-jc-c">
					<view class="btn-content">
						<view class="btn-content-lx" @click="determine">残忍取消</view>
						<view class="btn-content-phone" @click="show = false">还是去吧</view>
					</view>
				</view>
			</view>

		</u-modal>
		<u-toast ref="uToast" />
	</view>
</template>
<script src="./buy_order.js"></script>

<style lang="scss">
	@import './buy_order.scss';
</style>
